
package se.sll.service.catalogue.offers.api.resource;

import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import se.sll.service.catalogue.offers.api.model.Contract;


/**
 * Service for managing Contracts
 * 
 */
@Path("contracts")
public interface ContractsService {


    /**
     * List all contracts
     * 
     */
    @GET
    @Produces({
        "application/json"
    })
    ContractsService.GetContractsResponse getContracts()
        throws Exception
    ;

    /**
     * Create a new Contract
     * 
     * @param entity
     *      e.g. {
     *       "id":
     *       {
     *          "extension": "7f6c9cc1-7495-4b83-902b-f8e3220984ba",
     *          "root": "1.5.8.457.2.2"
     *       },
     *       "type":
     *       {
     *         "codeSystem": "1.2.758.9.21.3.1",
     *         "code": "45"
     *       },
     *       "datePeriod":
     *       {
     *         "start": "1427410800000",
     *         "end": "1448552000000"
     *       }
     *     }
     *     
     */
    @POST
    @Consumes("application/json")
    ContractsService.PostContractsResponse postContracts(Contract entity)
        throws Exception
    ;

    /**
     * Update a Contract
     * 
     * @param entity
     *      e.g. {
     *       "id":
     *       {
     *          "extension": "7f6c9cc1-7495-4b83-902b-f8e3220984ba",
     *          "root": "1.5.8.457.2.2"
     *       },
     *       "type":
     *       {
     *         "codeSystem": "1.2.758.9.21.3.1",
     *         "code": "45"
     *       },
     *       "datePeriod":
     *       {
     *         "start": "1427410800000",
     *         "end": "1448552000000"
     *       }
     *     }
     *     
     */
    @PUT
    @Consumes("application/json")
    @Produces({
        "application/json"
    })
    ContractsService.PutContractsResponse putContracts(Contract entity)
        throws Exception
    ;

    /**
     * Delete a contract
     * 
     * @param contractId
     *     
     */
    @DELETE
    @Path("{contractId}/")
    ContractsService.DeleteContractsByContractIdResponse deleteContractsByContractId(
        @PathParam("contractId")
        String contractId)
        throws Exception
    ;

    public class DeleteContractsByContractIdResponse
        extends se.sll.service.catalogue.offers.api.support.ResponseWrapper
    {


        private DeleteContractsByContractIdResponse(Response delegate) {
            super(delegate);
        }

        /**
         * The contract was deleted successfully (no content in response body)
         * 
         */
        public static ContractsService.DeleteContractsByContractIdResponse withoutContent() {
            Response.ResponseBuilder responseBuilder = Response.status(204);
            return new ContractsService.DeleteContractsByContractIdResponse(responseBuilder.build());
        }

    }

    public class GetContractsResponse
        extends se.sll.service.catalogue.offers.api.support.ResponseWrapper
    {


        private GetContractsResponse(Response delegate) {
            super(delegate);
        }

        /**
         * The requested contract information was found and is returned in the body. e.g. {
         *   "contracts": [
         *     {
         *       "id":
         *       {
         *         "extension": "7f6c9cc1-7495-4b83-902b-f8e3220984ba",
         *         "root": "1.5.8.457.2.2"
         *       },
         *       "type":
         *       {
         *         "codeSystem": "1.2.758.9.21.3.1",
         *         "code": "45"
         *       },
         *       "datePeriod":
         *       {
         *         "start": "1427410800000",
         *         "end": "1448552000000"
         *       }
         *     }
         *   ]
         * }
         * 
         * 
         * @param entity
         *     {
         *       "contracts": [
         *         {
         *           "id":
         *           {
         *             "extension": "7f6c9cc1-7495-4b83-902b-f8e3220984ba",
         *             "root": "1.5.8.457.2.2"
         *           },
         *           "type":
         *           {
         *             "codeSystem": "1.2.758.9.21.3.1",
         *             "code": "45"
         *           },
         *           "datePeriod":
         *           {
         *             "start": "1427410800000",
         *             "end": "1448552000000"
         *           }
         *         }
         *       ]
         *     }
         *     
         */
        public static ContractsService.GetContractsResponse jsonOK(List<Contract> entity) {
            Response.ResponseBuilder responseBuilder = Response.status(200).header("Content-Type", "application/json");
            responseBuilder.entity(entity);
            return new ContractsService.GetContractsResponse(responseBuilder.build());
        }

    }

    public class PostContractsResponse
        extends se.sll.service.catalogue.offers.api.support.ResponseWrapper
    {


        private PostContractsResponse(Response delegate) {
            super(delegate);
        }

        /**
         * The requested Contract was successfully created
         * 
         */
        public static ContractsService.PostContractsResponse created() {
            Response.ResponseBuilder responseBuilder = Response.status(201);
            return new ContractsService.PostContractsResponse(responseBuilder.build());
        }

    }

    public class PutContractsResponse
        extends se.sll.service.catalogue.offers.api.support.ResponseWrapper
    {


        private PutContractsResponse(Response delegate) {
            super(delegate);
        }

        /**
         * Update successful. e.g. {
         *   "id":
         *   {
         *      "extension": "7f6c9cc1-7495-4b83-902b-f8e3220984ba",
         *      "root": "1.5.8.457.2.2"
         *   },
         *   "type":
         *   {
         *     "codeSystem": "1.2.758.9.21.3.1",
         *     "code": "45"
         *   },
         *   "datePeriod":
         *   {
         *     "start": "1427410800000",
         *     "end": "1448552000000"
         *   }
         * }
         * 
         * 
         * @param entity
         *     {
         *       "id":
         *       {
         *          "extension": "7f6c9cc1-7495-4b83-902b-f8e3220984ba",
         *          "root": "1.5.8.457.2.2"
         *       },
         *       "type":
         *       {
         *         "codeSystem": "1.2.758.9.21.3.1",
         *         "code": "45"
         *       },
         *       "datePeriod":
         *       {
         *         "start": "1427410800000",
         *         "end": "1448552000000"
         *       }
         *     }
         *     
         */
        public static ContractsService.PutContractsResponse jsonOK(Contract entity) {
            Response.ResponseBuilder responseBuilder = Response.status(200).header("Content-Type", "application/json");
            responseBuilder.entity(entity);
            return new ContractsService.PutContractsResponse(responseBuilder.build());
        }

    }

}
